<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<% request.setAttribute("APP_PATH", request.getContextPath());%>
<html>
<body>
<header>
</header>
<h2>Hello World!</h2>
<script type="text/javascript" src="${APP_PATH}/static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="${APP_PATH}/static/js/util/jquery.qrcode.js"></script>
<script type="text/javascript" src="${APP_PATH}/static/js/util/utf.js"></script>

<button type="button" id="btn" class="btn btn-primary">查询</button>
<div id="qrcodePic" style="width:200px;height:200px;"></div>
<button type="button" id="btn2" class="btn btn-primary">测试</button>

<script type="text/javascript">
    $(document).on("click","#btn",function(){
        $.ajax({
            url:"${APP_PATH}/wxpay/ceshiceshi",
            type:"post",
            success:function(result){

                alert(result);
                // 生成二维码
                $("#qrcodePic").empty();
                $("#qrcodePic").css('padding-top','15px');

                $("#qrcodePic").qrcode({
                    render : "canvas",
                    text : result,
                    width : "400",               //二维码的宽度
                    height : "400",              //二维码的高度
//                    background : "#functionff",       //二维码的后景色
//                    foreground : "#000"        //二维码的前景色
                    //src: "static/img/qrcode_center.png"             //二维码中间的图片
                });
            }
        });
    });
    $(document).on("click","#btn2",function(){
        $.ajax({
            url:"${APP_PATH}/wxpay/cashWithDrawalJump",
            data:{"money":0.3, "type":0},
            type:"post",
            success:function(result){

                alert(result.extend.msg);
            }
        });
    });
</script>

</body>
</html>
